package com.ms.str.param;

/**
 *
 *静态成员变量按照定义顺序 进行初始化， 从上到下定义的顺序；
 *
 * @author carter
 * create time    2018-08-14
 */
public class TestStatic {


    private static TestStatic testStatic = new TestStatic();

    public static  int count1;

    public static int count2=0;


    private TestStatic()
    {
        count1++;
        count2++;
    }

    public static TestStatic getTestStatic() {
        return testStatic;
    }

    public static void main(String[] args) {

        TestStatic testStatic = TestStatic.getTestStatic();

        System.out.println("" +testStatic.count1);//1
        System.out.println("" +testStatic.count2);//0

    }

}
